update linux snap (#1110)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Sun, 14 May 2023 15:52:42 +0000 (09:52 -0600)
committerGitHub <noreply@github.com>
Sun, 14 May 2023 15:52:42 +0000 (09:52 -0600)
* switch snap from devmode to strict.

* date first in version string

* update snap: strict, no gui, layout

.github/workflows/ubuntu.yml
snap/snapcraft.yaml

index 247cb9c807326a67dc78a86b7d38044a12b0a44b..e5754277b49b6644579c6c52176fc37e393dfc39 100644 (file)
@@ -95,7 +95,7 @@ jobs:
     # Make sure the snap is installable
     - name: Test
       run: |
-        sudo snap install --devmode --dangerous ${{ steps.build-snap.outputs.snap }}
+        sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }}
         export GBTEMP=$(pwd)/gbtemp
         mkdir -p "$GBTEMP"
         /snap/bin/gpsbabel -D3 || true
index 1db316d0f6a2c710c2140e6a613447cad50098b4..cd88c786c7bb7b2d02d5989d167964cc5e955931 100755 (executable)
@@ -12,11 +12,25 @@ source-code: https://github.com/GPSBabel/gpsbabel.git
 website: https://www.gpsbabel.org
 
 grade: devel # must be 'stable' to release into candidate/stable channels
-confinement: devmode # use 'strict' once you have the right plugs and slots
+confinement: strict # use 'strict' once you have the right plugs and slots
 
 apps:
   gpsbabel:
-    command: /usr/bin/gpsbabel
+    plugs:
+      - home
+      - raw-usb
+      - removable-media
+      - serial-port
+    command: usr/bin/gpsbabel
+
+# remap the ubuntu qt6 install directories to the snap.
+layout:
+  /usr/share/qt6:
+    symlink: $SNAP/usr/share/qt6
+  /usr/lib/qt6:
+    symlink: $SNAP/usr/lib/qt6
+  /usr/lib/x86_64-linux-gnu/qt6:
+    symlink: $SNAP/usr/lib/x86_64-linux-gnu/qt6
 
 adopt-info: gpsbabel
 parts:
@@ -33,11 +47,13 @@ parts:
       craftctl default
       # add install command to CMakeLists.txt
       echo "install(TARGETS gpsbabel CONFIGURATIONS Release RUNTIME DESTINATION /usr/bin)" >> CMakeLists.txt
+      # no gui
+      sed -i -e's/add_subdirectory(gui)/#add_subdirectory(gui)/' CMakeLists.txt
       # jam repo sha into GITHUB_SHA
       sed -i -e"/GB.SHA/i set(ENV{GITHUB_SHA} \"$(git log -1 --format=%h)\")" gbversion.cmake
       # set snap version
       # ensure version has at most 32 characters
-      craftctl set version=$(git log -1 --format='LinuxInstaller-%h-%ad' --date=format:%Y%m%d)
+      craftctl set version=$(git log -1 --format='LinuxInstaller-%ad-%h' --date=format:%Y%m%d)
 
     build-packages:
       - git
@@ -51,21 +67,6 @@ parts:
       - libudev-dev
       - qt6-base-dev
       - libqt6core5compat6-dev
-      - libqt6opengl6-dev
-      - libqt6serialport6-dev
-      - libqt6webenginecore6-bin
-      - libgl-dev
-      - libopengl-dev
-      - libvulkan-dev
-      - libx11-xcb-dev
-      - libxkbcommon-dev
-      - qt6-l10n-tools
-      - qt6-tools-dev
-      - qt6-tools-dev-tools
-      - qt6-translations-l10n
-      - qt6-webengine-dev
-      - qt6-webengine-dev-tools
-      - qt6-wayland
     stage-packages:
       - zlib1g
       - libshp2